1. Field of the Invention
This invention relates to storage systems and, more particular, to managing remapped portions of a storage medium.
2. Description of the Related Art
The data-storing area of a typical hard drive platter is organized into several concentric rings, or tracks. Each track is subdivided into sectors. Sectors each store data (e.g., a multiple of 512 bytes of data) and/or housekeeping information. Each sector may include a header, data, and/or a trailer. The header may include a preamble that synchronizes read circuits to the data, an ID field that identifies the sector, flags used during defect management, and a checksum that validates and/or corrects the header. The data field may include a synchronizing field and a data area that stores user data. The trailer may contain checksum or error correction information, providing protection against data errors. Other storage media (e.g., optical storage media such as CDs (Compact Disks) and magneto-optical storage media) are also typically subdivided into similar data-storing portions.
Often, the representation of a storage medium at the operating system level is different from the actual physical configuration of that storage medium. For example, a storage medium may be represented as a list of logical block addresses at the operating system level. In contrast, the physical configuration of the storage medium may be significantly more complex. Hard disks, for example, may include several platters that are each subdivided into tracks, and different tracks may contain different numbers of sectors. Generally, a storage device's controller or device driver remaps the logical addresses used to specify data at the operating system level into the physical identifiers that locate the physical portion of the storage medium that stores the data.
A storage medium such as a hard disk may have or develop bad portions (e.g., sectors, tracks, etc.) that cannot reliably store data. In order to avoid using bad portions of the storage medium, bad sectors may be marked and remapped to other portions of the storage medium. This remapping may remap a logical address from the bad portion of the storage medium to a new portion of the storage medium. Because there is a tendency for bad portions of a storage medium to be spatially adjacent to each other, some storage device drivers and/or controllers may remap portions that surround a bad portion as a safety precaution. Bad portions of a storage medium that arise during manufacturing are normally detected, marked, and remapped by the manufacturer. Bad sectors that develop later in the storage device's lifetime may be detected during scans of the storage medium or when an error is detected during an access operation (e.g., a read or write). These bad portions may also be remapped to new portions by a device driver or device controller.
If a subsequent access operation specifies a bad portion of a storage medium (e.g., by specifying the logical address previously mapped to that portion), the drive controller or device driver may use mapping information to redirect the operation to the new portion to which the bad portion was mapped. In some hard drives, the mapping information for a particular sector may be stored in that sector's header information. Thus, the mapping information for a bad sector may not be available until the bad sector's header information has been read. In other drives, a defect mapping table or list that shows the mapping information for all or part of the drive may be stored in system memory or in the drive controller memory in order to avoid unnecessarily accessing the bad sector of the hard disk.
The storage device (or the storage device driver) may maintain one or more lists of defective sectors in order to avoid using those sectors. For example, if the storage device is a SCSI (Small Computer System Interface) hard drive, the manufacturer-created list of bad sectors is called the PLIST (Primary List). Other lists may include the CLIST (Certification List), which lists bad sectors discovered during a certification procedure, the DLIST (Data Defect List), and the GLIST (Grown List). Bad sectors added to the CLIST and/or the DLIST are added to the GLIST, which lists all defective sectors that have been detected (except those already included on the PLIST).
When a bad portion of a storage medium is detected and remapped, the data that was stored in that portion may be copied to a new portion. However, the data that the bad portion was storing may be corrupt. Thus, the data stored to the new portion may not be guaranteed to be correct.